<?php

namespace plugin\ycMassage\app\validate;

use think\Validate;


class MassageTechnician extends Validate
{
    public $rule =   [
        'age' => 'require|between:18,70',
        'province_id' => 'require',
        'city_id' => 'require',
        'gender' => 'require',
        'mobile' => 'require|mobile',
        'work_meet' => 'require|between:0,60',
        'thumb' => 'require|array|length:3,9',
        'regions' => 'require|array|length:2',
    ];

    protected $message  =   [
        'age.require' => '年龄必须',
        'age.between' => '年龄18~70岁',
        'province_id.require' => '请选择入驻城市',
        'city_id.require' => '请选择入驻城市',
        'gender.require' => '请选择性别',
        'mobile.require' => '手机号必须',
        'mobile.mobile' => '手机号格式不正确',
        'work_meet.require' => '工作年限必须',
        'work_meet.between' => '工作年限0~60年',
        'thumb.require' => '请上传至少3张技师图片',
        'thumb.array' => '请上传至少3张技师图片',
        'thumb.length' => '技师图片3~9张',
        'regions.require' => '请选择入驻区域',
        'regions.array' => '请选择入驻区域',
        'regions.length' => '请选择入驻区域',
    ];
    protected $scene = [
        'apply' => ['name', 'age', 'province_id', 'city_id', 'gender', 'mobile', 'work_meet', 'thumb'],
        'admin_create' => ['name', 'age', 'gender', 'mobile', 'work_meet', 'thumb', 'regions'],
        'admin_update' => ['name', 'age', 'gender', 'mobile', 'work_meet', 'regions'],
    ];
}
